﻿<UserControl x:Class="NexTrackDesktop.Controls.GuestsTab"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:media="clr-namespace:NexTrackDesktop.NexTrack"
             mc:Ignorable="d" 
             d:DesignHeight="485" d:DesignWidth="651">

    <UserControl.Resources>
        <!--Static Resource for Testing -->
        <x:Array Type="media:User" x:Key="Invited">
            <media:User FacebookID="213" Name="Adam" Picture="http://images.instagram.com/profiles/profile_37262315_75sq_1334068272.jpg" Link="http://images.instagram.com/profiles/profile_37262315_75sq_1334068272.jpg" />
            <media:User FacebookID="23" Name ="Testing" Picture="http://distilleryimage1.s3.amazonaws.com/3ff0f43664a711e2a2fe22000a1f8ce3_6.jpg"/>
            <media:User FacebookID="2354" Name ="Testingasdf" Picture="http://images.instagram.com/profiles/profile_2546353_75sq_1357177097.jpg" />
        </x:Array>
        <!--Static Resource for Testing -->
        <x:Array Type="media:User" x:Key="Requested">
            <media:User FacebookID="2354" Name ="Testingasdf" Picture="http://images.instagram.com/profiles/profile_2546353_75sq_1357177097.jpg" />
        </x:Array>
        <!--Static Resource for Testing -->
        <x:Array Type="media:User" x:Key="Friends">
            <media:User FacebookID="213" Name="Adam" Picture="http://images.instagram.com/profiles/profile_37262315_75sq_1334068272.jpg" Link="http://images.instagram.com/profiles/profile_37262315_75sq_1334068272.jpg" />
            <media:User FacebookID="asdf" Name ="asdfsd" Picture="http://images.instagram.com/profiles/profile_234753726_75sq_1349931500.jpg"/>
            <media:User FacebookID="23" Name ="Testing" Picture="http://distilleryimage1.s3.amazonaws.com/3ff0f43664a711e2a2fe22000a1f8ce3_6.jpg"/>
            <media:User FacebookID="2354" Name ="Testingasdf" Picture="http://images.instagram.com/profiles/profile_2546353_75sq_1357177097.jpg" />
            <media:User FacebookID="osijf" Name ="Testing234" Picture="http://images.instagram.com/profiles/profile_239637092_75sq_1350660855.jpg"/>
        </x:Array>
    </UserControl.Resources>

    <Grid>
        <!--Split up Main 3 piece view-->
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="50*" />
            <ColumnDefinition Width="50*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="50*" />
            <RowDefinition Height="50*" />
        </Grid.RowDefinitions>
        <!--Used for Resizing-->
        <GridSplitter Width="3" Height="Auto" HorizontalAlignment="Right" VerticalAlignment="Stretch" ResizeDirection="Columns" />
        <GridSplitter Grid.ColumnSpan="2" Width="Auto" Height="3" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" ResizeDirection="Rows" />

        <!-- Invited -->
        <ListBox d:DataContext="{StaticResource Invited}" ItemsSource="{Binding Path=.}" Margin="0, 0, 3, 3">
            <ListBox.ItemTemplate>
                <DataTemplate>
                      <Grid Height="32" HorizontalAlignment="Stretch">
                        <!--Columns for Picture, Name, and Button-->
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="100" />
                            <ColumnDefinition Width="60" />
                        </Grid.ColumnDefinitions>
                        <!--Bind User Picture and name-->
                        <Image Source="{Binding Picture}" />
                        <Label Grid.Column="1" Content ="{Binding Name}" />
                        <Button Grid.Column="2" Name="removeInvited" Content="Remove" />  
                    </Grid>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>

        <!--Requested-->
        <ListView Grid.Column="1" Margin="0,0,0,3">
            <ListBox d:DataContext="{StaticResource Requested}" ItemsSource="{Binding Path=.}" >
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Grid Height="32" HorizontalAlignment="Stretch">
                            <!--Columns for Picture, Name, Allow and Deny Buttons-->
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="100" />
                                <ColumnDefinition Width="60" />
                                <ColumnDefinition Width="60" />
                            </Grid.ColumnDefinitions>
                            <!--Bind User Picture and Name-->
                            <Image Source="{Binding Picture}" />
                            <Label Grid.Column="1" Content ="{Binding Name}" />
                            <Button Grid.Column="2" Name="allowRequested" Content="Allow" />
                            <Button Grid.Column="3" Name="denyRequested" Content="Deny" />
                        </Grid>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </ListView>

        <!-- All Facebook Friends-->
        <ListView Grid.Row="1" Grid.ColumnSpan="2">
            <ListBox d:DataContext="{StaticResource Friends}" ItemsSource="{Binding Path=.}" >
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Grid Height="32" HorizontalAlignment="Stretch">
                            <!--Columns for Image, Name, and Button-->
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="100" />
                                <ColumnDefinition Width="60" />
                            </Grid.ColumnDefinitions>
                            <!--Bind User Picture and Name-->
                            <Image Source="{Binding Picture}" />
                            <Label Grid.Column="1" Content ="{Binding Name}" />
                            <Button Grid.Column="2" Name="inviteFriend" Content="Invite" Focusable="False"/>
                        </Grid>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </ListView>
    </Grid>
</UserControl>